//
//  CGLCustomSegment.m
//  HomeFurnishingDecoration
//
//  Created by 李劲成 on 16/4/24.
//  Copyright © 2016年 ljc. All rights reserved.
//

#import "CGLCustomSegment.h"

@implementation CGLCustomSegment

- (instancetype)initWithItems:(NSArray *)items {
    self = [super initWithItems:items];
    if (self) {
        [self setTintColor:[UIColor colorWithRed:0.90 green:0.90 blue:0.90 alpha:1.0]];
//        [self setTintColor:[UIColor whiteColor]];
        NSDictionary * selectedTextAttributes = @{NSFontAttributeName:[UIFont boldSystemFontOfSize:16],NSForegroundColorAttributeName: [UIColor blueColor]};
        self.selectedSegmentIndex = 0;
        [self setTitleTextAttributes:selectedTextAttributes forState:UIControlStateSelected];//设置文字属性
        NSDictionary* unselectedTextAttributes = @{NSFontAttributeName:[UIFont boldSystemFontOfSize:16],NSForegroundColorAttributeName: [UIColor whiteColor]};
        [self setTitleTextAttributes:unselectedTextAttributes forState:UIControlStateNormal];
    }
    return self;
}




@end
